<template>
  <el-container class="goods-edit">
     
    <el-main class="sa-p-t-10">
      <el-main class="sa-p-0">
      <div class="sa-table-wrap" v-loading="loading">
        <el-table
            height="500px"
            class="sa-table"
            :data="table.data"
            row-key="id"
            stripe
        >
          <template #empty>
            <sa-empty></sa-empty>
          </template>
          
          <el-table-column  prop="id" label="用户昵称" min-width="100"></el-table-column>
          
          <el-table-column prop="type_txt" label="手机号" min-width="120"/>
          <el-table-column prop="type_txt" label="任务类型" min-width="120"/>
          <el-table-column prop="type_txt" label="任务方式" min-width="120"/>
          <el-table-column prop="type_txt" label="是否已结算" min-width="120"/>
          <el-table-column prop="create_time" label="发布时间" width="172">
            <template #default="scope">{{ scope.row.create_time || '-' }}</template>
          </el-table-column>
          <el-table-column prop="name" label="平台"></el-table-column>
          <el-table-column prop="name" label="任务名称"></el-table-column>
          <el-table-column prop="name" label="会员等级"></el-table-column>
          <el-table-column prop="name" label="预计收入"></el-table-column>
          <el-table-column prop="name" label="视频地址"></el-table-column>
          <el-table-column prop="status_txt" label="播放数(24012)" min-width="120"></el-table-column>
          <el-table-column prop="status_txt" label="分享数(24012)" min-width="120"></el-table-column>
          <el-table-column prop="status_txt" label="评论数(24012)" min-width="120"></el-table-column>
          <el-table-column prop="name" label="拒绝原因 "></el-table-column>





            <el-table-column label="操作"  fixed="right">
              <template #default="scope">
                <div class="sa-flex" style="flex-wrap: wrap;">
                  <el-button
                      class="is-link sa-m-l-12"
                      type="primary"
                      @click="handle(scope.row)"

                  >审核
                  </el-button>
                <text style="color:#32cb4f">审核通过</text>
                 
                </div>
              </template>
            </el-table-column>
          
        
          
          
        </el-table>
      </div>
      </el-main>
      <sa-view-bar>
        
        <template #right>
          <sa-pagination :pageData="pageData" @updateFn="getData"/>
        </template>
      </sa-view-bar>
      

      

      

      
    </el-main>
   
  </el-container>
</template>
<script setup>
import { onMounted,ref, reactive,  getCurrentInstance } from 'vue';
import { api } from '../exmaine.service';
import {useModal, usePagination} from '@/sheep/hooks';
import HandleExamine from '../comment/handleExamine.vue';

import {  isEmpty, cloneDeep } from 'lodash';
const loading = ref(false);



const { proxy } = getCurrentInstance();

const emit = defineEmits(['modalCallBack']);
const props = defineProps({
  modal: {
    type: Object,
  },
});

const {pageData} = usePagination();
// 表格
const table = reactive({
  data: [],
  order: null,
  selected: [],
});
// 获取详情
async function getData(page,e) {
  loading.value = true;
  if (page) pageData.page = page;
  
 
  const {error, data} = await api.raise.list({
    page: pageData.page,
    list_rows: pageData.list_rows,
  });
  if (error === 0) {
    table.data = data.data;
    pageData.page = data.current_page;
    pageData.list_rows = data.per_page;
    pageData.total = data.total;
   
  }
  loading.value = false;
}

// 审核
function handle(row){
  useModal(
    HandleExamine,
    {
      title: '修改审核状态',
      class:'sa-width-600'
    },
    {
      confirm: () => {
      },
    },
  );
}


async function init() {
  await getData();
}
onMounted(() => {
  init();
});
</script>
<style lang="scss" scoped>
div{
  font-size:13px;
}
.left-t{
  color: #777777;
  text-align: right;
  flex-shrink: 0;
  word-break:keep-all;
}
.title{
  font-size:18px;
  margin:15px 0 15px 20px;
}
.line{
  line-height: 2em;
  align-items: start;
}
</style>

